1. Field of the Invention
The present invention relates to an image conversion apparatus and method for converting an image.
2. Description of the Related Art
A white board, a business card, a document, or the like is captured using a digital camera, and the captured image is saved in a recording medium and managed. At this time, if the rectangular object is captured from an oblique direction, a perspective distortion occurs so that the object is distorted to a quadrilateral other than the rectangle in the captured image. In addition, since there is a distortion that is determined at the time of lens design and tends to become large in a wide angle lens or the like, a distortion occurs on the captured image.
U.S. Pat. No. 7,619,663 describes a technique of performing projection transformation for a perspective distortion and distortion correction for a distortion, thereby generating an image free from both distortions from an image containing both distortions. Japanese Patent Laid-Open No. 2009-211171 describes a technique of capturing a face, a fingerprint, or the like using a digital camera and checking the captured image with a check image. Also described is performing projection transformation for a perspective distortion of a captured image and correcting a nonlinear distortion as well.
In projection transformation, a CPU executes, for each pixel, a numeric data process such as multiplication that is relatively time-consuming. If a CPU or a numeric data processor capable of operating at a high speed is incorporated, the scale of the calculation circuits becomes large. To prevent this, Japanese Patent Laid-Open No. 11-312238 describes a technique of speeding up the process without a multiplication process. In the technique described in Japanese Patent Laid-Open No. 11-312238, the x-axis and y-axis of the coordinates of an image are made to correspond to the row address and column address of a memory, respectively. Based on the correspondence between coordinates before conversion and those after conversion, a pixel value read out from an address of coordinates before conversion is stored in an address of the coordinates after conversion. At this time, shift amounts of the row address and column address are obtained concerning the coordinates before and after conversion. The shift amounts are added and subtracted, thereby specifying one read or write address. The technique of Japanese Patent Laid-Open No. 11-312238 executes the above-described process by providing a bus line that transfers data by direct memory access between a transfer source memory and a transfer destination memory before and after projection transformation.
Japanese Patent Laid-Open No. 3-058285 describes a method of performing, without a multiplication process, an image enlargement/reduction process that is a form of projection transformation. In the method described in Japanese Patent Laid-Open No. 3-058285, two kinds of clocks, that is, a reference clock and a thinning clock are provided. The thinning clock is supplied to a memory that handles a smaller image out of the transfer source and transfer destination memories, thereby performing the image enlargement/reduction process. Japanese Patent Laid-Open No. 10-23247 describes an image enlargement/reduction processing method that sequentially adds the increment of a read address determined in accordance with the enlargement/reduction ratio and calculates the read address without a multiplication process.
However, in inverse projection transformation for obtaining the coordinate values of input image data corresponding to the coordinate values of output image data in projection transformation for correcting a perspective distortion, a plurality of multiplication processes need to be executed. If it is necessary to process one image data in a short time as in a moving image process, the plurality of multiplication processes place a heavy load. Hence, hardware in which a plurality of multipliers are arranged in parallel or a high-speed calculation device (for example, CPU) is required.
In the method described in Japanese Patent Laid-Open No. 11-312238, no coordinate values are calculated. Since an interpolation process using a plurality of neighbor pixels cannot be performed, the image quality largely degrades. In addition, distortion correction for a distortion is nonlinear transformation. For this reason, data cannot be transferred by one transfer between the transfer source and transfer destination memories before and after conversion including projection transformation.
In the methods described in Japanese Patent Laid-Open Nos. 3-058285 and 10-23247, the transfer source and transfer destination memories are connected on the row basis so that, for example, data of the fifth row of the transfer source memory is transferred to the third row of the transfer destination memory. For this reason, these methods are applicable only to the image enlargement/reduction process that is one form of projection transformation but not to a projection transformation process using an arbitrary parameter.
Image data captured by a digital camera or the like is generally converted into a format such as JPEG, MPEG, or H.264 by an image coding process and then saved in a storage device or externally output. The image coding process is generally performed on a block basis (for example, 8×8). Hence, when image data after projection transformation is output in the raster scan order, the image data after the projection transformation needs to be converted into the order of the block process before it is input to the device for performing the image coding process. For example, assume that one block has a size of 8×8 pixels. The image coding process of a block on the leftmost column can be executed only after the projection transformation of the first eight pixels of the eighth row is completed. For this reason, a buffer memory having a large capacity is necessary for holding the image after the projection transformation.